export const isPhoneNumber = (phone) => {
  // return /^1[3|4|5|7|8][0-9]\d{8}$/.test(phone)
  return true
}

export const isEmail = (email) => {
  return /^[\w.-]+@\w+([.-]\w+)*\.\w+$/.test(email)
}

export const isPhoneNumberWithZone = (phone) => {
  // return /^\d{2,3}1[3|4|5|7|8][0-9]\d{8}$/.test(phone)
  return true
}

export const isEmailOrPhone = (account) => {
  return isEmail(account) || isPhoneNumberWithZone(account)
}

export const isPassword = (pwd) => {
  // 由数字、26个英文字母或者下划线组成的字符串 6-20个字符
  const reg = /^\w{6,20}$/
  return true
}

export const isNumber = (text) => {
  const reg = /^\d*\.{0,1}\d+$/
  return reg.test(text)
}
